/*=====================================================
Critical Links
Auto Configuration Server

Authors:
	Rui Eduardo Gouveia Gil - r-gil@critical-links.com

Date: 2011
Version 0.1
=======================================================*/
Group = function(xml) {
	var xmlDoc = parseXML(xml);

	this.type = 'g';
	
	this.id = xmlDoc.getElementsByTagName("ID")[0].childNodes[0].nodeValue;
	this.name = xmlDoc.getElementsByTagName("Name")[0].childNodes[0].nodeValue;
	this.updated = xmlDoc.getElementsByTagName("Updated")[0].childNodes[0].nodeValue;
	this.creation = xmlDoc.getElementsByTagName("Creation")[0].childNodes[0].nodeValue;
	this.updatedStr = xmlDoc.getElementsByTagName("UpdatedStr")[0].childNodes[0].nodeValue;
	this.creationStr = xmlDoc.getElementsByTagName("CreationStr")[0].childNodes[0].nodeValue;
	if(xmlDoc.getElementsByTagName("Description")[0].childNodes.length != 0)
		this.description = xmlDoc.getElementsByTagName("Description")[0].childNodes[0].nodeValue;
	else
		this.description = "";
	this.deviceCount = xmlDoc.getElementsByTagName("DeviceCount")[0].childNodes[0].nodeValue;

	this.tid = this.type+this.id;
	this.text = this.name + " (" + this.deviceCount + ")";
};

Ext.reg('appgroup', Group);